package com.tpc.control.jpa;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * SaleDataId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class SaleDataId implements java.io.Serializable {

	// Fields

	private String saleOrder;
	private String saleItem;

	// Constructors

	/** default constructor */
	public SaleDataId() {
	}

	/** full constructor */
	public SaleDataId(String saleOrder, String saleItem) {
		this.saleOrder = saleOrder;
		this.saleItem = saleItem;
	}

	// Property accessors

	@Column(name = "sale_order", nullable = false, length = 20)
	public String getSaleOrder() {
		return this.saleOrder;
	}

	public void setSaleOrder(String saleOrder) {
		this.saleOrder = saleOrder;
	}

	@Column(name = "sale_item", nullable = false, length = 6)
	public String getSaleItem() {
		return this.saleItem;
	}

	public void setSaleItem(String saleItem) {
		this.saleItem = saleItem;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof SaleDataId))
			return false;
		SaleDataId castOther = (SaleDataId) other;

		return ((this.getSaleOrder() == castOther.getSaleOrder()) || (this
				.getSaleOrder() != null
				&& castOther.getSaleOrder() != null && this.getSaleOrder()
				.equals(castOther.getSaleOrder())))
				&& ((this.getSaleItem() == castOther.getSaleItem()) || (this
						.getSaleItem() != null
						&& castOther.getSaleItem() != null && this
						.getSaleItem().equals(castOther.getSaleItem())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getSaleOrder() == null ? 0 : this.getSaleOrder().hashCode());
		result = 37 * result
				+ (getSaleItem() == null ? 0 : this.getSaleItem().hashCode());
		return result;
	}

}